//package com.zj.ssm.util;
//
//import javax.servlet.FilterChain;
//import javax.servlet.ServletException;
//import javax.servlet.ServletRequest;
//import javax.servlet.ServletResponse;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.io.IOException;
//import java.util.Arrays;
//import java.util.List;
//
//public class FilterUtil {
//    public static void haha(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain)throws IOException, ServletException {
//        HttpServletRequest  req = (HttpServletRequest) servletRequest;
//        HttpServletResponse resp = (HttpServletResponse) servletResponse;
//
//
//        String contextPath = req.getContextPath();
//        String requestURI = req.getRequestURI();
//
//        String path = requestURI.replace(contextPath, "");
//
//        String[]  pass = {
//
//                "/index.html",
//                "/admin/login",
//                "/admin/index.html",
//
//        };
//        List<String> passList = Arrays.asList(pass);
//
//        if(   ! passList.contains( path )  ){
//            Object admin = req.getSession().getAttribute("admin");
//            if(admin == null){
//                resp.sendRedirect("/ssm/index.html");
//                return;
//            }
//        }
//        filterChain.doFilter(req,resp);
//    }
//}
//
